


<!DOCTYPE html>
<html id="htmlId">
<head>
  <title>Coverage Report > SinglePlayerGame</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">nl.tudelft.jpacman.game</a>
</div>

<h1>Coverage Summary for Class: SinglePlayerGame (nl.tudelft.jpacman.game)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">SinglePlayerGame</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/4)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/9)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package nl.tudelft.jpacman.game;
&nbsp;
&nbsp;import java.util.List;
&nbsp;
&nbsp;import nl.tudelft.jpacman.level.Level;
&nbsp;import nl.tudelft.jpacman.level.Player;
&nbsp;
&nbsp;import com.google.common.collect.ImmutableList;
&nbsp;import nl.tudelft.jpacman.points.PointCalculator;
&nbsp;
&nbsp;/**
&nbsp; * A game with one player and a single level.
&nbsp; *
&nbsp; * @author Jeroen Roosen 
&nbsp; */
<b class="nc">&nbsp;public class SinglePlayerGame extends Game {</b>
&nbsp;
&nbsp;    /**
&nbsp;     * The player of this game.
&nbsp;     */
&nbsp;    private final Player player;
&nbsp;
&nbsp;    /**
&nbsp;     * The level of this game.
&nbsp;     */
&nbsp;    private final Level level;
&nbsp;
&nbsp;    /**
&nbsp;     * Create a new single player game for the provided level and player.
&nbsp;     *
&nbsp;     * @param player
&nbsp;     *            The player.
&nbsp;     * @param level
&nbsp;     *            The level.
&nbsp;     * @param pointCalculator
&nbsp;     *            The way to calculate points upon collisions.
&nbsp;     */
&nbsp;    protected SinglePlayerGame(Player player, Level level, PointCalculator pointCalculator) {
<b class="nc">&nbsp;        super(pointCalculator);</b>
<b class="nc">&nbsp;        assert player != null;</b>
<b class="nc">&nbsp;        assert level != null;</b>
&nbsp;
<b class="nc">&nbsp;        this.player = player;</b>
<b class="nc">&nbsp;        this.level = level;</b>
<b class="nc">&nbsp;        this.level.registerPlayer(player);</b>
&nbsp;    }
&nbsp;
&nbsp;    @Override
&nbsp;    public List&lt;Player&gt; getPlayers() {
<b class="nc">&nbsp;        return ImmutableList.of(player);</b>
&nbsp;    }
&nbsp;
&nbsp;    @Override
&nbsp;    public Level getLevel() {
<b class="nc">&nbsp;        return level;</b>
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2023-04-23 16:26</div>
</div>
</body>
</html>
